<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
	<meta charset="UTF-8">
	<link rel="shortcut icon" href="favicon.ico">
	<link rel="stylesheet" href="css/iconfont.css">
	<link rel="stylesheet" href="css/global.css">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="css/swiper.min.css">
	
	
	<link rel="stylesheet" href="css/styles.css">
	<script src="js/jquery.1.12.4.min.js" charset="UTF-8"></script>
	<script src="js/bootstrap.min.js" charset="UTF-8"></script>
	<script src="js/swiper.min.js" charset="UTF-8"></script>
	<script src="js/global.js" charset="UTF-8"></script>
	<script src="js/jquery.DJMask.2.1.1.js" charset="UTF-8"></script>
	<script type="text/javascript" src="layer/layer.js"></script>
	<title>广内殿</title>
</head>
<script type="text/javascript" src="js/jquery-3.1.1.min.js" ></script>


<body>

	<script type="text/javascript">
	
	
	function getQueryVariable(variable){
	       var query = window.location.search.substring(1);
	       var vars = query.split("&");
	       for (var i=0;i<vars.length;i++) {
	               var pair = vars[i].split("=");
	               if(pair[0] == variable){return pair[1];}
	       }
	       return(false);
		}
	
		$(function(){
			var u=JSON.parse(window.localStorage.getItem("user"));
			console.log(u);
			if (u!=null) {
				$("#yinCang").hide();
				$("#xianShi").show();
				$("#uName").html(u.username);
				$("#uId").html(u.uid);
			}
			
			
			var id=getQueryVariable("id");
			$.post("getBooks",{
				id:id
			},function(res){
				
				$("#productName").html(res.name);
				$("#onSaleTime").html(res.onSaleTime);
				$("#author").html(res.author);
				$("#press").html(res.press);
				$("#ibsn").html(res.ibsn);
				$("#edition").html(res.edition);
				$("#commodityCode").html(res.commodityCode);
				$("#packing").html(res.packing);
				$("#paper").html(res.paper);
				$("#pageNumber").html(res.pageNumber);
				$("#wordNumber").html(res.wordNumber);
				$("#packing").html(res.packing);
				$("#packing").html(res.packing);
				$("#packing").html(res.packing);
				$("#bookName").html(res.name);
				$("#price").html(res.discountPrice);
				$("#sellPrice").html(res.sellPrice);
				$("#kuCun").html(res.stock);
				$("#name").html(res.name);
				$("#BooksImg").append(`
						
					<div class="small-box">
						<img class="cover" src="images/${res.img} " >
						
					</div>	
					
						`)
				
			},"json")	
			
			
		})	
			
		var categoryId=getQueryVariable("categoryId");
		$(function(){
			$.post("getCategoryBooks",{
				categoryId:categoryId
			},function(res){
				console.log(res)
				for(var i=0;i<res.length;i++){
					$("#baoKuan").append(`
						<a class="picked-item" href="item_show.html?id=${res[i].id}&categoryId=${res[i].categoryId}">
							<img src="images/${res[i].img}" alt="" class="cover">
							<div class="look_price">${res[i].sellPrice}元</div>
						</a>	
							`)
				}
			},"json")
		})
		
		
		
		$(function(){
			
			var id=getQueryVariable("id");
			$.post("getCommon",{
				bookId:id
			},function(res){
				console.log(res);
				for(var i=0;i<=res.length;i++){
					$("#bookCommon").append(`
						
							<div  class="eval-box">
							<div class="eval-author">
								<div class="port">
									<img src="images/icons/default_avt.png" alt="欢迎来到U袋网" class="cover b-r50">
								</div>
								<div class="name">${res[i].user.username}</div>
							</div>
							<div class="eval-content">
								<div class="eval-text">
									${res[i].content}
								</div>
								
								<div class="eval-time">
									${res[i].date}
								</div>
							</div>	
						</div>
							`)
				}
			},"json")
		})
	function gwc(){
			var id=getQueryVariable("id");
			var u=JSON.parse(window.localStorage.getItem("user"));
			$.post("insertCart",{
				uid:u.uid,
				bookId:id,
				number:$("#shuLiang").val()
			},function(res){
				console.log(res)
				if(res.code=="0"){
					layer.msg("添加成功");
					window.location.href ="udai_shopcart.html" ;
				} else{
					layer.msg("添加失败")
				}
			},"json")
	
		}
	
	</script>
	
	
	
	
	
	<!-- 顶部tab -->
	<div class="tab-header">
		<div class="inner">
			<div class="pull-left">
				<div class="pull-left">嗨，欢迎来到<span class="cr">广内殿</span></div>
			</div>
			<div class="pull-right">
				<span id="yinCang"> <a href="login.html"><span class="cr">登录</span></a>
					<a href="login2.html">注册</a>
				</span> <span style="display: none;" id="xianShi"> uid:<span
					id="uId"></span> 欢迎:<span id="uName"></span>
				</span> 
				<a href="udai_welcome.html">个人中心</a>
				<a href="udai_order.html">我的订单</a>
			</div>
		</div>
	</div>
	<!-- 搜索栏 -->
	<div class="top-search">
		<div class="inner">
			<a class="logo" href="index.html"><img src="images/icons/logo.jpg" alt="U袋网" class="cover"></a>
			<div class="search-box">
				<form class="input-group">
					<input placeholder="Ta们都在搜承明殿" type="text">
					<span class="input-group-btn">
						<button type="button">
							<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
						</button>
					</span>
				</form>
			</div>
			<div class="cart-box">
				<a href="udai_shopcart.html" class="cart-but">
					<i class="iconfont icon-shopcart cr fz16"></i> 购物车
				</a>
			</div>
		</div>
	</div>
	<!-- 内页导航栏 -->
	<div class="top-nav bg3">
		<div class="nav-box inner">
			<div class="all-cat">
				<div class="title"><i class="iconfont icon-menu"></i> 全部分类</div>
			</div>
			<ul class="nva-list">
				<a href="index.html"><li>首页</li></a>
			</ul>
		</div>
	</div>
	<div class="content inner">
		<section class="item-show__div item-show__head clearfix">
			<div class="pull-left">
				<ol class="breadcrumb">
					<li><a href="index.html">首页</a></li>
					<li><a href="item_category.html">爆款推荐</a></li>
					<li class="active"><span id="name"></span></li>
				</ol>
				<div id="BooksImg" style="height: 450px;" class="item-pic__box" >
					
				</div>
				<script src="js/jquery.magnifier.js"></script>
				<script>
					$(function () {
						$('#magnifier').magnifier();
					});
				</script>
				<div id="book" class="item-info__box">
					<div class="item-title">
						<div class="name ep2">商品名称: <span id="bookName" style="font-size:21px"></span></div>
						
					</div>
					<div class="item-price bgf5">
						<div class="price-box clearfix">
							<div class="price-panel pull-left">
								折扣价：<span id="price" class="price"></span>
								 <s class="fz16 c9">
								 原价:<span id="sellPrice"></span>
								 </s>
							</div>
						</div>
						
					</div>
					
					
					<div class="item-key">
						
						<div class="item-amount clearfix bgf5">
							<div class="item-metatit">数量：</div>
							<div class="amount-box">
								<div class="amount-widget">
									<input class="amount-input" value="1" id="shuLiang" maxlength="8" title="请输入购买量" >
									
								</div>
								
								<div class="item-stock"><span style="margin-left: 10px;">库存 <b id="Stock"><span id="kuCun"></span></span></b> 件</span></div>
								
							</div>
						</div>
						<div class="item-action clearfix bgf5">
							
							<button  rel="nofollow" onclick="gwc()" data-addfastbuy="true" role="button" class="item-action__basket">
								<i class="iconfont icon-shopcart"></i> 加入购物车
							</button>
						</div>
					</div>
				</div>
			</div>
			<div   class="pull-right picked-div">
				<div class="lace-title">
					<span class="c6">爆款推荐</span>
				</div>
				<div class="swiper-container picked-swiper">
					<div  class="swiper-wrapper">
						<div id="baoKuan" class="swiper-slide">
						
						</div>
					</div>
				</div>
			</div>
		</section>
		<section class="item-show__div item-show__body posr clearfix">
			<div class="item-nav-tabs">
				<ul class="nav-tabs nav-pills clearfix" role="tablist" id="item-tabs">
					<li role="presentation" class="active"><a href="#detail" role="tab" data-toggle="tab" aria-controls="detail" aria-expanded="true">商品详情</a></li>
					<li role="presentation"><a href="#evaluate" role="tab" data-toggle="tab" aria-controls="evaluate">累计评价 <span class="badge"></span></a></li>
				</ul>
			</div>
			<div class="pull-left">
				<div class="tab-content">
					<div role="tabpanel" class="tab-pane fade in active" id="detail" aria-labelledby="detail-tab">
						 <div class="item-detail__info clearfix">
							<div class="record">商品名称：<span id="productName"></span></div>
							<div class="record">上架时间：<span id="onSaleTime"></span></div>
							<div class="record">作者：<span id="author"></span></div>
							<div class="record">出版社：<span id="press"></span></div>
							<div class="record">书号：<span id="ibsn"></span></div>
							<div class="record">版本：<span id="edition"></span></div>
							<div class="record">商品编码：<span id="commodityCode"></span></div>
							
							<div class="record">包装：<span id="packing"></span></div>
							<div class="record">用纸：<span id="paper"></span></div>
							<div class="record">页数：<span id="pageNumber"></span></div>
							<div class="record">字数：<span id="wordNumber"></span></div>
						</div> 
						
					</div>
					<div role="tabpanel" class="tab-pane fade" id="evaluate" aria-labelledby="evaluate-tab">
						<div class="evaluate-tabs bgf5">
							<ul class="nav-tabs nav-pills clearfix" role="tablist">
								<li role="presentation" class="active"><a href="#all" role="tab" data-toggle="tab" aria-controls="all" aria-expanded="true">全部评价 <span class="badge"></span></a></li>
								
							</ul>
						</div>
						<div class="evaluate-content">
							<div class="tab-content">
								<div id="bookCommon" role="tabpanel" class="tab-pane fade in active"  aria-labelledby="all-tab">

								</div>
									
								</div>
							</div>
							
						</div>
					</div>
					
			    </div>
				
			</div>
			<div class="pull-right">
				<div class="tab-content" id="descCate">
					
					<div role="tabpanel" class="tab-pane fade" id="evaluate-tab" aria-labelledby="evaluate-tab">
						<div class="descCate-content posr bgf5">
							<div class="lace-title">
								<span class="c6">相关推荐</span>
							</div>
							<div class="picked-box">
								<a class="picked-item" href="">
									<img src="images/temp/S-001-1_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-2_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-3_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-4_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-5_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
							</div>
						</div>
					</div>
					<div role="tabpanel" class="tab-pane fade" id="service-tab" aria-labelledby="service-tab">
						<div class="descCate-content posr bgf5">
							<div class="lace-title">
								<span class="c6">最近浏览</span>
							</div>
							<div class="picked-box">
								<a class="picked-item" href="">
									<img src="images/temp/S-001-1_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-2_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-3_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-4_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
								<a class="picked-item" href="">
									<img src="images/temp/S-001-5_s.jpg" class="cover">
									<div class="look_price">¥134.99</div>
								</a>
							</div>
						</div>
					</div>
				</div>
			</div>
			<script>
				$(document).ready(function(){
					$('#descCate').smartFloat(0);
					$('.dc-idsItem').click(function() {
						$(this).addClass('selected').siblings().removeClass('selected');
					});
					$('#item-tabs a[data-toggle="tab"]').on('show.bs.tab', function (e) {
						$('#descCate #' + $(e.target).attr('aria-controls') + '-tab')
						.addClass('in').addClass('active').siblings()
						.removeClass('in').removeClass('active');
					});
				});
			</script>
		</section>
	</div>
	<!-- 右侧菜单 -->
	<div class="right-nav">
		<ul class="r-with-gotop">
			<li class="r-toolbar-item">
				<a href="udai_welcome.html" class="r-item-hd">
					<i class="iconfont icon-user" data-badge="0"></i>
					<div class="r-tip__box"><span class="r-tip-text">用户中心</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="udai_shopcart.html" class="r-item-hd">
					<i class="iconfont icon-cart"></i>
					<div class="r-tip__box"><span class="r-tip-text">购物车</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="udai_collection.html" class="r-item-hd">
					<i class="iconfont icon-aixin"></i>
					<div class="r-tip__box"><span class="r-tip-text">我的收藏</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="" class="r-item-hd">
					<i class="iconfont icon-liaotian"></i>
					<div class="r-tip__box"><span class="r-tip-text">联系客服</span></div>
				</a>
			</li>
			<li class="r-toolbar-item">
				<a href="issues.html" class="r-item-hd">
					<i class="iconfont icon-liuyan"></i>
					<div class="r-tip__box"><span class="r-tip-text">留言反馈</span></div>
				</a>
			</li>
			<li class="r-toolbar-item to-top">
				<i class="iconfont icon-top"></i>
				<div class="r-tip__box"><span class="r-tip-text">返回顶部</span></div>
			</li>
		</ul>
		<script>
			$(document).ready(function(){ $('.to-top').toTop({position:false}) });
		</script>
	</div>
	<!-- 底部信息 -->
	<div class="footer">
		<div class="footer-tags">
			<div class="tags-box inner">
				<div class="tag-div">
					<img src="images/icons/footer_1.gif" alt="厂家直供">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_2.gif" alt="一件代发">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_3.gif" alt="美工活动支持">
				</div>
				<div class="tag-div">
					<img src="images/icons/footer_4.gif" alt="信誉认证">
				</div>
			</div>
		</div>
		<div class="footer-links inner">
			<dl>
				<dt>U袋网</dt>
				<a href="temp_article/udai_article10.html"><dd>企业简介</dd></a>
				<a href="temp_article/udai_article11.html"><dd>加入U袋</dd></a>
				<a href="temp_article/udai_article12.html"><dd>隐私说明</dd></a>
			</dl>
			<dl>
				<dt>服务中心</dt>
				<a href="temp_article/udai_article1.html"><dd>售后服务</dd></a>
				<a href="temp_article/udai_article2.html"><dd>配送服务</dd></a>
				<a href="temp_article/udai_article3.html"><dd>用户协议</dd></a>
				<a href="temp_article/udai_article4.html"><dd>常见问题</dd></a>
			</dl>
			<dl>
				<dt>新手上路</dt>
				<a href="temp_article/udai_article5.html"><dd>如何成为代理商</dd></a>
				<a href="temp_article/udai_article6.html"><dd>代销商上架教程</dd></a>
				<a href="temp_article/udai_article7.html"><dd>分销商常见问题</dd></a>
				<a href="temp_article/udai_article8.html"><dd>付款账户</dd></a>
			</dl>
		</div>
		<div class="copy-box clearfix">
			<ul class="copy-links">
				<a href="agent_level.html"><li>网店代销</li></a>
				<a href="class_room.html"><li>U袋学堂</li></a>
				<a href="udai_about.html"><li>联系我们</li></a>
				<a href="temp_article/udai_article10.html"><li>企业简介</li></a>
				<a href="temp_article/udai_article5.html"><li>新手上路</li></a>
			</ul>
			<!-- 版权 -->
			<p class="copyright">
				© 2005-2017 U袋网 版权所有，并保留所有权利<br>
				ICP备案证书号：闽ICP备16015525号-2&nbsp;&nbsp;&nbsp;&nbsp;福建省宁德市福鼎市南下村小区（锦昌阁）1栋1梯602室&nbsp;&nbsp;&nbsp;&nbsp;Tel: 18650406668&nbsp;&nbsp;&nbsp;&nbsp;E-mail: 18650406668@qq.com
			</p>
		</div>
	</div>
</body>
</html>